#-*- coding: utf8 -*-
from tutor.script import *
from tutor.plugin.maple import *

# variáveis úteis
half = M('1/2')
t = M.t
_i, _j, _k = M('_i, _j, _k')
rr = M('`..`')
coeff = M.coeff

# parâmetros iniciais
c1 = M(oneof(-2, -1, 1, 1, -1, -2, 3))
c2 = M(oneof(-2, -1, 1, 1, -1, -2, 3))
c3 = M(oneof(-2, -1, 1, 1, -1, -2, 3))
c4 = M(oneof(-2, -1, 1, 1, -1, -2, 3))
c5 = M(oneof(-2, -1, 1, 1, -1, -2, 3))
c6 = M(oneof(-2, -1, 1, 1, -1, -2, 3))
c7 = M(oneof(-2, -1, 1, 1, -1, -2, 3))
c8 = M(oneof(1, 2))

# campo
F = fieldF = (c1 * x + c2 * y) * _i + \
             (c3 * x + c4 * z) * _j + \
             (c5 * z + c6 * y + c7) * _k

# --- resultados --------------------------------------------------------------
print('campo: %s' % F)

# correto 
campo = (c1 + c5) * 4 * Pi / 3 * c8 ** 3
print('campo: %s' % campo)

# erros
intarea = (c1 + c5) * 4 * Pi * c8 ** 2
print('intarea: %s' % intarea)

nodiv = c7 * 4 * Pi / 3 * c8 ** 3
print('nodiv: %s' % nodiv)
